Re: Pango warning: Invalid UTF-8 string
Murray Cumming wrote: No, it's called Glib::filename_to_utf8(): http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/group__CharsetConv.html#ga7 though it might sometimes be the same thing. I also tried this function but it didn't work. The error was still there. Not so with locale_to_utf8(). What is filename_to_utf8() supposed to do? What is special about a filename what other strings don't have (considering that characters like slashes can as well be part of a normal character sequence) and why would it fail where locale_to_utf8() works? The filenames I'm displaying don't contain any slashes by the way. It's just the leafs of the paths I'm displaying (e.g. instead of /usr/local/share I'm displaying share). -- Matthias Kaeppler ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list
Re: Pango warning: Invalid UTF-8 string
On Mon, 2005-07-18 at 10:28 +0200, Matthias Kaeppler wrote: Murray Cumming wrote: No, it's called Glib::filename_to_utf8(): http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/group__CharsetConv.html#ga7 though it might sometimes be the same thing. I also tried this function but it didn't work. The error was still there. Not so with locale_to_utf8(). What is filename_to_utf8() supposed to do? What is special about a filename what other strings don't have (considering that characters like slashes can as well be part of a normal character sequence) and why would it fail where locale_to_utf8() works? The filenames I'm displaying don't contain any slashes by the way. It's just the leafs of the paths I'm displaying (e.g. instead of /usr/local/share I'm displaying share). If you are getting the filename from the FileChooser, the Note: here might be helpful: http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1FileChooser.html std::string - ustring involves an automatic encoding conversion, so that might be confusing things. -- Murray Cumming [EMAIL PROTECTED] www.murrayc.com www.openismus.com ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list
Re: Pango warning: Invalid UTF-8 string
Murray Cumming wrote: If you are getting the filename from the FileChooser, the Note: here might be helpful: http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1FileChooser.html std::string - ustring involves an automatic encoding conversion, so that might be confusing things. Hm, no, the std::stringS come from Gnome::Vfs::FileInfo::get_name(). Converting them to a ustring using filename_to_utf8() does, well, nothing. Most surprisingly locale_to_utf8() works in this case. Regards, Matthias -- Matthias Kaeppler ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list
how to make tree view headers clickable
I would like to make the headers of some tree views clickable, so that the user can sort their contents by the collumn header he clicks on, like we see this for example in the gnome-sytem-monitor, or the gtk-demo. However, i did not find out how to activate this behavour - Gtk::TreeView::set_headers_clickable(...) didn't change anything for me ... I'm using gtkmm-2.6.3. Thanks, Antonio ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list
Re: best way to use multiple windows
Well, it is heap vs stack - I am not sure which is really better for normal gui applications. But I have always created my dialogs as pointers - it just seems more traditional c++. MyPopupDialog *dlg = new MyPopupDialog(...) { //set dialog to modal (but it can sometimes get hidden by other // dialog which is annoying // set up dialog display here // let okay/cancel buttons set return variable flag and hide dialog onokaybutton() { returnFlag = 1; dlg-hide(); } // if flag true can have code engine or main dialog still read // values from popup dlg here delete dlg; I find it is not too difficult to match the delete with the new. Armin Burgmeier wrote: Hi, my approach to this is to derive such windows from Gtk::Dialog and to add two buttons with Gtk::RESPONSE_OK and Gtk::RESPONSE_CANCEL. To show the dialog, simply do MyDialog dialog(*this, foo, bar); if(dialog.run() == Gtk::RESPONSE_OK) { // Take settings into main app } Gtk::Dialog::run blocks in a main loop until the user closes the window by either pressing one of the buttons or closing the window (which fits perfectly if you want modal windows). After your function returns, the dialog will be destroyed automatically as it runs out of scope, so you do not have to worry about memory management. - Armin ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list
Re: 4 numbers on 2 different rows, in a single tree cell
Bob, Thanks for your response. I guess, the main question I have with respect to the suggestions you made is if there is any way to pack a Gtk::Table into a tree cell. Or, in the second case, if there is a way of packing a VBox into a cell. Is this even doable? I've seen people doing all sorts of impossible things with cell renderers, but I'm not certain if the two things above are accomplishable. What do you think? Regards, Nickolai On Mon, Jul 18, 2005 at 05:33:59AM -0500, Bob Caryl wrote: Hello Nickolai, Have you tried creating a two column, two row Gtk::Table and attaching four Gtk::Labels each containing one of the four numbers with the Gtk::Label alignments set to achieve the four - cornered look you seek; and then packing the Gtk::Table into the tree row cell? Another idea would be a Gtk::VBox containing two Gtk::HBoxs each of which containing two Gtk::Labels, with the alignments set to achieve the four - cornered effect; finally packing the Gtk::VBox into the cell itself. I don't know if either of these ideas would work, since I have not tried them myself. Bob Caryl ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list
Re: best way to use multiple windows
Armin Burgmeier wrote: John Taber wrote: Well, it is heap vs stack - I am not sure which is really better for normal gui applications. But I have always created my dialogs as pointers - it just seems more traditional c++. Isn't that dangerous if exceptions are thrown? Why not let the compiler Yeah, I think c++ in general is pretty dangerous:) And I guess that's why there is java and C#. I'm always open to better ideas. Whatever is the fastest, simplest, cleanest. We've always called all our widgets with pointers as well, since we've never really taken the time to figure out what the memory hit is, especially if there are a few layers of dialogs open as per the original question in the thread and not sure what happens if one of the widgets is a 500 mb image. But your idea of the dialog container on stack but widgets on heap would be efficient if it doesn't cause other problems - and I guess you're saying gtkmm takes care of that. John do the dirty work? Remember that just the gtkmm instances like a Gtk::Dialog are created on the stack, but they create their underlaying GTK+ objects on the heap. This method seems to be the C++ way for me. But if you like using dynamically allocated memory here, go on. I just wanted to add another alternative how to display popup dialogs :) - Armin ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list
Re: best way to use multiple windows
John Taber wrote: Well, it is heap vs stack - I am not sure which is really better for normal gui applications. But I have always created my dialogs as pointers - it just seems more traditional c++. Isn't that dangerous if exceptions are thrown? Why not let the compiler do the dirty work? Remember that just the gtkmm instances like a Gtk::Dialog are created on the stack, but they create their underlaying GTK+ objects on the heap. This method seems to be the C++ way for me. But if you like using dynamically allocated memory here, go on. I just wanted to add another alternative how to display popup dialogs :) - Armin ___ gtkmm-list mailing list gtkmm-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtkmm-list