LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   MonoDevolop question (https://www.linuxquestions.org/questions/programming-9/monodevolop-question-4175673070/)

program1 04-12-2020 08:25 AM

MonoDevolop question
 
Hi,
I started using Monodevelop in Linux Mint, to write up a gui in c#, but I'm finding using gtk to make a gui isn't
as easy as it is in Visual Studio (in Windows). One problem I've run into is when I add a "text view" widget
it's only showing 1 line for text, and it isn't wrapping text, I'm not sure why.
There's no toggle for the widget setting for text wrapping either.
Anyone know how to get it so a text window in Monodevelop is capable of multiple lines ?

program1 04-12-2020 03:01 PM

Sorry, I think I found the problem, I added an Entry instead of a TextBox,
now I have multiple lines including a workable scrollbar.

Although, on the MonoDevelop website they have an example of using TextBox : https://www.monodevelop.com/document...-gui-designer/
which uses a buffer for (delayed) sending text to the textbox.
Anyone know why ? and if there's a more immediate way to append/add text to the textbox ?

rtmistler 04-12-2020 04:00 PM

If so, then glad you got it solved.

Please use the Thread Tools menu and mark the thread as solved so that it may possibly help someone with a similar problem in the future.

program1 04-12-2020 05:35 PM

Ok, thanks, I had a follow-up question, but I'll mark it as solved.

rtmistler 04-12-2020 05:50 PM

Absolutely ask your follow up question. This is your thread.

program1 04-12-2020 06:21 PM

Ok, thanks.
Hopefully last question regarding this textbox in MonoDevelop.
When I write a simple loop to generate some text, it doesn't show the
text, nor update the progressbar, until after the loop is actually over, code here :

protected void Button_click(object sender, EventArgs e)
{
for (loop=1; loop<=3000; loop++)
{
array1[loop] = loop;
textview1.Buffer.Text += loop.ToString() + "\n";

progressbar1.Fraction = (loop / 3000);
progressbar1.Text = ((loop / 3000)*100).ToString();
}
}


How can I get the text and progressbar to update during each iteration of the for-loop
progresses ?

SoftSprocket 04-13-2020 07:22 AM

You probably want to read this: https://www.mono-project.com/docs/gu...-applications/

program1 04-18-2020 12:12 PM

Quote:

Originally Posted by SoftSprocket (Post 6111031)

Yea, I think that describes the problem going on :(
This makes making GUIs with MonoDevelop & GTK a lot more complex than I prefer,
especially after using the much simpler Visual Studio on Windows.

Does anyone know a alternative to MonoDevelop that makes it simple for creating GUIs to
work with C#, C, or C++ on Linux Mint ?
Sorry if I sound lazy, I just don't like spending extensive amount of time dinking around
with having to code and/or design GUIs and getting them to work :twocents:

SoftSprocket 04-19-2020 11:51 AM

I'm not sure if there is another C# IDE but of course there are many C and C++ alternatives. Are they simpler? I guess that's a judgement call.

I use C# and VS extensively, on Windows, in my professional life and it can get pretty complex depending of course on the complexity of the project and the gui library.

All the gui libraries I've used have some form of loop in which events are handled. Updates outside of the thread where the loop runs usually require some tap dancing to manage data integrity; in the main event thread, timing issues often require management.

I recently took a new look at some of the libraries around for C and C++ gui development. I personally wound up continuing with QT though I'm opting to learn to use it without relying on the macros that often seem to muddy things (for me). Ultimate++ is an IDE for cross-platform C++ development with a strong business leaning (i.e. its libraries are oriented towards business applications) that impressed me but since my personal interests don't run to doing business applications the QT libraries were of greater interest to me.

GTK has been ported to many languages and so there might be an advantage to learning it, I suppose depending on your own approach to programming.

kareempharmacist 04-19-2020 12:22 PM

For C++ on Linux Mint, you can use Qt Creator. It has a GUI designer and works on Linux, Windows and Mac.

program1 04-19-2020 01:37 PM

Quote:

Originally Posted by kareempharmacist (Post 6113530)
For C++ on Linux Mint, you can use Qt Creator. It has a GUI designer and works on Linux, Windows and Mac.


Yea, I saw QT, but it's like $5000/year license, ouch . I'll have to pass on that.

I did discover some threading work-arounds that seem to work in MonoDevelop,
it's just going to be a learning process with the new environment :study:

Thanks for the suggestion and help

SoftSprocket 04-19-2020 02:32 PM

QT is free for open source: https://doc.qt.io/qt-5/opensourcelicense.html

program1 04-19-2020 02:42 PM

Oh, I didn't catch that, thanks !

EdGr 04-19-2020 02:50 PM

Quote:

Originally Posted by program1 (Post 6113201)
Does anyone know a alternative to MonoDevelop that makes it simple for creating GUIs to work with C#, C, or C++ on Linux Mint ?
Sorry if I sound lazy, I just don't like spending extensive amount of time dinking around
with having to code and/or design GUIs and getting them to work :twocents:

Glade is the GUI builder for GTK. For a complex GUI, using Glade is much easier than writing C code.

That being said, GTK is not particularly good at minimizing the number of lines of code. A simple GUI starts at around 500 lines. Once written, that can be used as a template for additional GUIs.
Ed


All times are GMT -5. The time now is 12:54 AM.